package com.study.enummap;

public enum ErrorPhase {
	SOLID, LIQUID, GAS;
	
	public enum Transition{
		MELT, FREEZE, BOIL, CONDENSE, SUBLIME, DEPOSIT;
		
		private static final Transition[][] TRANSITIONS = {
			{ null,    MELT,     SUBLIME},
			{ FREEZE,  null,     BOIL},
			{ DEPOSIT, CONDENSE, null}
		};
		
		public static Transition from(ErrorPhase src, ErrorPhase dst){
			return TRANSITIONS[src.ordinal()][dst.ordinal()];
		}
	}
}
